
#pragma once

#include <AVUIModel3D.h>
#include <AVUIModel3DCollection.h>

namespace AVUI {

class Geometry3D;
class Material;

class Model3DGroup : public Model3D
{
public:
    Model3DGroup() { };

    DECLARE_ELEMENT(Model3DGroup, Model3D);

    DECLARE_DEPENDENCY_PROPERTY_BEGIN(Children);
        DECLARE_ATTRIBUTE_CONTENTPROPERTY();
        DECLARE_ATTRIBUTE_AUTOCREATE();
    DECLARE_DEPENDENCY_PROPERTY_END();
    TRefCountedPtr<Model3DCollection> get_Children() { return (Model3DCollection*)(Object*)GetValue(get_ChildrenProperty()); }
    void set_Children(Model3DCollection* pValue) { SetValue(get_ChildrenProperty(), (Object*)pValue); } 

    virtual void Render3D(Renderer* pRenderer, const Matrix3D& parentMatrix);
    virtual void RenderDependencies3D(Renderer* pRenderer);

    virtual Rect3D CalculateSubgraphBoundsInnerSpace() AVUI_OVERRIDE; 
    virtual void RayHitTestCore(RayHitTestParameters* pRayParams) AVUI_OVERRIDE;

protected:
    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<Model3DGroup>().get_Ptr(); }

private:
    static void StaticConstructor();
};


}; // namespace AVUI
